package com.happyhome.datamodel;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the users database table.
 * 
 */
@Entity
@Table(name="USERS")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;
	private String username;
	private String avatar;
	private Date birthday;
	private String email;
	private Boolean enabled;
	private String fullName;
	private Long hometownId;
	private String identifierPassport;
	private String mobile;
	private String note;
	private String password;
	private Boolean status;
	private Set<House> houses = new HashSet<House>();
	private Set<UserRole> userRoles = new HashSet<UserRole>();
	private Set<Image> images = new HashSet<Image>();
	
	public User() {
	}


	@Id
	@Column(name="username")
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}


	@Column(name="AVATAR")
	public String getAvatar() {
		return this.avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}


	@Temporal(TemporalType.TIMESTAMP)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name="EMAIL")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name="enabled")
	public Boolean getEnabled() {
		return this.enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}


	@Column(name="FULL_NAME")
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}


	@Column(name="HOMETOWN_ID")
	public Long getHometownId() {
		return this.hometownId;
	}

	public void setHometownId(Long hometownId) {
		this.hometownId = hometownId;
	}


	@Column(name="IDENTIFIER_PASSPORT")
	public String getIdentifierPassport() {
		return this.identifierPassport;
	}

	public void setIdentifierPassport(String identifierPassport) {
		this.identifierPassport = identifierPassport;
	}

	@Column(name="MOBILE")
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name="NOTE")
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Column(name="password")
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}


	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}


	//bi-directional many-to-one association to House
	@OneToMany(mappedBy="user", fetch = FetchType.LAZY)
	public Set<House> getHouses() {
		return this.houses;
	}

	public void setHouses(Set<House> houses) {
		this.houses = houses;
	}

	//bi-directional many-to-one association to UserRole
	@OneToMany(mappedBy="user", fetch = FetchType.LAZY)
	public Set<UserRole> getUserRoles() {
		return this.userRoles;
	}

	public void setUserRoles(Set<UserRole> userRoles) {
		this.userRoles = userRoles;
	}
	
	@OneToMany(mappedBy="user", fetch = FetchType.LAZY)
	public Set<Image> getImages() {
		return this.images;
	}

	public void setImages(Set<Image> images) {
		this.images = images;
	}
}